package com.ky.pro.java.rpc.hd.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ky.pro.java.rpc.hd.common.entity.Account;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * 账户表 Mapper 接口
 * </p>
 *
 * @author Kevin Dummy
 * @since 2022-01-02
 */
public interface AccountMapper extends BaseMapper<Account> {

    /**
     * 根据账号ID更新余额
     *
     * @param accountId
     * @param currency     - 币种
     * @param balanceToAdd - 余额增量，可为负数
     * @return
     */
    int updateBalanceByAccountId(@Param("accountId") long accountId, @Param("currency") int currency, @Param("balanceToAdd") long balanceToAdd);

}
